<html>
<head>
<title>${msg:upload.title}</title>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
${css:weboo}
${js:weboo}
<style rel="styleshee" type="text/css">
a.btn
{
font-size:11px;
text-decoration:none;
display:inline-block;
margin-left:4px;
margin-right:4px;
border:1px solid #BBBBEE;
padding:2px;
padding-left:10px;
padding-right:10px;
}
a.btn:link{color:#000000;text-decoration:none;}
a.btn:active{color:#000000;text-decoration:none;}
a.btn:visited{color:#000000;text-decoration:none;}
a.btn:hover{
color:#8888AA;
text-decoration:none;
background-color:#F0F0FF;
border:1px solid #CCCCFF;
}

form
{
margin:0px;
}

input
{
font-size:12px;
font-family:Arial,Times;
line-height:16px;
}

input.file
{
background-color:#EEEEFF;
color:#5566EE;
}

input.disabled
{
background-color:#EEEEEE;
color:#AAAAAA;
font-style:italic;
}

body
{
margin:0px;
overflow:hidden;
}

.scrollPanel
{
width:100%;
height:100%;
overflow:scroll;
scrollbar-arrow-color:#000000;
scrollbar-base-color:#CCCCFF;
scrollbar-darkshadow-color:#CCCCFF;
scrollbar-face-color:#CCCCFF;
scrollbar-highlight-color:#FFFFFF;
scrollbar-shadow-color:#FFFFFF; 
scrollbar-3dlight-color:#CCCCFF;
}
</style>
<script language="JavaScript">
var index = 0;
var types = "${@types}";
function sendAll()
{
	index = 0;
	send();
}

function send()
{
	if(document.forms.length<=index) return;
	var form = document.forms[index];
	var icon = form.getElementsByTagName("IMG")[0];
	if(form.data.value.length>0 && !form.data.disabled)
	{
		var path = new String(form.data.value);
		var pos = path.lastIndexOf(".");
		var ext = "["+path.substring(pos+1)+"]";
		var ext = ext.toLowerCase();
		if(types.length>0 && types.indexOf(ext)<0)
		{
			icon.style.visibility = "visible";
			icon.src = ihelpuoo.http.server().icon("warn.gif","weboo");
			index ++;
			send();
		}
		else
		{
			icon.style.visibility = "visible";
			icon.src = ihelpuoo.http.server().icon("loading.gif","weboo");
			form.submit();
		}
	}
	else
	{
		index ++;
		send();
	}
}

function addFile()
{
	var shell = document.getElementById("zzh");
	var div = document.createElement("DIV");
	var html = "<form target=weboo_upload_getter action=\"";
	html += ihelpuoo.http.server().url("upload","indexedFileUpload");
	html += "\" method=POST enctype=multipart/form-data>";
	html += "<table border=0 cellspacing=2 cellpadding=2><tr>";
	html += "	<td><img class=icon16 style=visibility:hidden></td>";
	html += "	<td><input class=file type=file name=data size=40></td>";
	html += "</tr></table></form>";
	div.innerHTML = html;
	shell.appendChild(div);
}

function onOk()
{
	var form = document.forms[index];
	var icon = form.getElementsByTagName("IMG")[0];
	icon.src = ihelpuoo.http.server().icon("uploaded.gif","upload");
	form.data.disabled = true;
	form.data.className="disabled";
	index++;
	send();
}

function onError(msg)
{
	alert("error:" + msg);
	var form = document.forms[index];
	var icon = form.getElementsByTagName("IMG")[0];
	icon.src = ihelpuoo.http.server().icon("deleted.gif","upload");
	form.data.disabled = true;
	form.data.className="disabled";
	index++;
	send();
}

function zzh()
{
	alert(document.forms[0].data.value)
}

function reloadPage()
{
	document.location.reload();
}
/*
 method="post" enctype="multipart/form-data"
 */
</script>
</head>
<body>
<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
<tr height="1" bgcolor="#CCCCFF">
	<td style="padding:2px;border-bottom:1px solid #CCCC99">
		<a class="btn" href="javascript:void(0)" onclick="sendAll()" title="${msg:upload.send.cmt}">
			<img src="${icon:send}" class="icon16"> ${msg:upload.send}</a>
		<a class="btn" href="javascript:void(0)" onclick="addFile()" title="${msg:upload.add.cmt}">
			<img src="${icon:addfile}" class="icon16"> ${msg:upload.add}</a>
		<a class="btn" href="javascript:void(0)" onclick="reloadPage()" title="${msg:upload.clear.cmt}">
			<img src="${icon:refresh}" class="icon16"> ${msg:upload.clear}</a>
		<iframe name="weboo_upload_getter" width="100%" height="100" style="display:none"></iframe>
	</td>
</tr>
<tr>
	<td><div id="zzh" class="scrollPanel"></div></td>
</tr>
</table>


</body>
</html>
<script language="JavaScript">
ihelpuoo.logLevel = 5;
ihelpuoo.http.server().rootPath = "${appRoot}";
ihelpuoo.http.server().module = "${module}";
</script>